package cn.avalon.controller;

import cn.avalon.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.security.PublicKey;

/**
 * @description: User启动类
 * @author: Avalon
 * @date: 2022年09月22日 ： 10:27
 * @version: ver1.0
 * @email 709785494@qq.com
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Value("${server.port}")
    private String port;

    @Value("${test.name}")
    private String name;

    @GetMapping("/{id}")
    public User findById(@PathVariable("id") Long id) {

        int a = 1 / 0;

        return new User(id, "源码时代", "我在源码时代学习Java!，端口号：" + port + ", dynamicRefreshTest：" + name);
    }
}
